const is = {
  keyword: (x) => {
    return /^(import|native|fun|var|const|set|int|string|if|elif|else|return|none|while|for|as)$/.test(x)
  },
  digit: (ch) => {
    return /[0-9]/i.test(ch)
  },
  idStart: (ch) => {
    return /[a-z_$]/i.test(ch)
  },
  id: (ch) => {
    return is.idStart(ch) || '0123456789'.indexOf(ch) >= 0
  },
  operator: (ch) => {
    return '+-*/%:=&|<>!'.indexOf(ch) >= 0
  },
  punctuation: (ch) => {
    return ',;(){}[]'.indexOf(ch) >= 0
  },
  whitespace: (ch) => {
    return ' \t\n'.indexOf(ch) >= 0
  },
  comment: (ch) => {
    return ch === '#'
  },
  dot: (ch) => {
    return ch === '.'
  }
}

export default is
